home *** CD-ROM | disk | FTP | other *** search
/ Merciful 1 / Merciful - Disc 1.iso / software / r / rexx_plus_compiler / rexxpluscompiler2.dms / in.adf / Examples / editgrep.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1991-08-28  |  595 b   |  31 lines

  1. /* */
  2. address command
  3. parse arg str fil'\'list
  4.  
  5. proc = 'ram:'pragma('i')'.txed'
  6. if list = ''
  7. then do
  8.     list = 'ram:'pragma('i')
  9.     say 'grep >'list '-l' str fil
  10.     'grep >'list '-l' str fil
  11.     if rc ~= 0 then exit rc
  12.     end
  13.  
  14.  
  15. call open('grep',proc,'w')
  16. call writeln('grep','/* */')
  17. call writeln('grep','startup')
  18. call writeln('grep','''MENU 1 F "Find entry" "F 'str'"''')
  19. call writeln('grep',"'F "str"'")
  20. call writeln('grep','exit 0')
  21. call close('grep')
  22.  
  23. call open('grep',list)
  24.  
  25. do while ~eof('grep')
  26.     file = readln('grep')
  27.     file = strip(file)
  28.     if file ~= ''
  29.     then 'ed' file 'STARTUP' proc 'STICKY'
  30.     end
  31.